import type { PatientInfo, UserInfo } from '@/types/user'
import { request } from '@/utils/request'
// 获取用户信息
const getUserInfoAPI = () => {
  return request<UserInfo>('patient/myUser')
}
// 获取患者列表信息
const getPatientInfoAPI = () => {
  return request<PatientInfo[]>('patient/mylist')
}
// 添加患者信息
const addPatientInfoAPI = (patientInfo: PatientInfo) => {
  return request('patient/add', 'POST', patientInfo)
}
// 编辑患者信息
const editPatientInfoAPI = (patientInfo: PatientInfo) => {
  return request('patient/update', 'PUT', patientInfo)
}
// 删除患者信息
const delPatientAPI = (id: string) => {
  return request(`patient/del/${id}`, 'DELETE')
}
// 查询患者信息
const queryPatientAPI = (id: string) => {
  return request<PatientInfo>(`patient/info/${id}`)
}

export {
  getUserInfoAPI,
  getPatientInfoAPI,
  addPatientInfoAPI,
  editPatientInfoAPI,
  delPatientAPI,
  queryPatientAPI
}
